<?php
/**
 * Truncate helper
 */
class Zend_View_Helper_MemberLoginBox extends Zend_View_Helper_Abstract
{
	public function MemberLoginBox()
	{
		$html = '';
		$identity = Member_Service_User::getIdentity();
		if(isset($identity->username)) {//TODO : trouver moyen de ne pas utiliser username, mais seulement $identity
			$html = '<ul>';
			$html .= '<li>username : ' . $identity->username . '</li>';
			$html .= '<li>email : ' . $identity->email . '</li>';
			$html .= '<li><a href="' . $this->view->url(array('module'=>'member','controller'=>'user','action'=>'logout')) . '">Logout</a></li>';
			$html .= '</ul>';			
		} else {
			$html = '<a href="' . $this->view->url(array('module'=>'member','controller'=>'user','action'=>'login')) . '">Login</a>';
		}	
		return $html;
	}
}
